home *** CD-ROM | disk | FTP | other *** search
- Path: sed.psrw.com!psinntp!psinntp!psinntp!pipeline!not-for-mail
- From: luciferm@nyc.pipeline.com (manjila thapa)
- Newsgroups: comp.lang.c
- Subject: returning address of value to main
- Date: 10 Apr 1996 22:08:58 -0400
- Organization: The Pipeline
- Message-ID: <4khpjq$a3c@pipe1.nyc.pipeline.com>
- NNTP-Posting-Host: pipe1.nyc.pipeline.com
- X-Newsreader: TIN [version 1.2 PL1]
-
- I want to return the address of element of an array
- a[0]....a[n]....a[m-1] (address of a[n] is to be returned)
- from a function to the main so that:
-
- main(){
- double *newarr;
- ...
- ...
- newarr= function(......) /*function is supposed to return address*/
- __________________________________________
- i tried
-
- return &a[n];
-
- in function but it doesn't work! Isn't this the right way to get the
- address? (this is part of my hw, hope u don't mind)
- thanks
- manny
-
-
-